package cn.kgc.service.impl;

import cn.kgc.dao.TrainDao;
import cn.kgc.pojo.Train;
import cn.kgc.service.TrainService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: fighting
 * @date: 2022/2/14
 * @description:
 */
@Service
public class TrainServiceImpl implements TrainService {

    @Resource
    private TrainDao trainDao;

    @Override
    public boolean add(Train train) {
        if(trainDao.add(train)>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean add2(Train train) {
        if (trainDao.add2(train)>0){
            return true;
        }
        return false;
    }

    @Override
    public List<Train> sel() {
        return trainDao.sel();
    }

    @Override
    public Train selById(Integer trainId) {
        return trainDao.selById(trainId);
    }

    @Override
    public boolean fuhe(Train train) {
        if(trainDao.fuhe(train)>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean fuhe2(Train train) {
        if(trainDao.fuhe2(train)>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean del(Integer trainId) {
        if(trainDao.del(trainId)>0){
            return true;
        }
        return false;
    }

    @Override
    public Train FKsel(Integer trainId) {
        return trainDao.FKsel(trainId);
    }

    @Override
    public boolean FKupd(Train train) {
        if(trainDao.FKupd(train)>0){
            return true;
        }
        return false;
    }

    @Override
    public Train updsel(Integer trainId) {
        return trainDao.updsel(trainId);
    }

    @Override
    public boolean upd(Train train) {
        if(trainDao.upd(train)>0){
            return true;
        }
        return false;
    }

    @Override
    public String getData(String name) {
        return trainDao.getData(name);
    }

    @Override
    public Page<Train> MoHuFenYe(String name, String status, String startTime) {
        return trainDao.MoHuFenYe(name, status, startTime);

    }


}
